package com.guyan.form;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * ClassName： ShippingForm
 * Date： 2021/6/11 17:45
 *
 * @author 孤焰
 * @version 1.0
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ShippingForm {
    @NotNull(message = "用户Id不能为空")
    private Integer userId;
    @NotBlank(message = "收件人名称不能为空")
    private String receiverName;
    @NotBlank(message = "收件人手机号不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "收件人手机格式不正确")
    private String receiverPhone;
    @NotBlank(message = "省份不能为空")
    private String receiverProvince;
    @NotBlank(message = "城市不能为空")
    private String receiverCity;
    @NotBlank(message = "区/县不能为空")
    private String receiverDistrict;
    @NotBlank(message = "收件详细地址不能为空")
    private String receiverAddress;
    @NotBlank(message = "邮政编码不能为空")
    @Pattern(regexp = "^[0-8][0-7]\\d{4}$", message = "邮政编码格式不正确")
    private String receiverZip;
}
